{% extends 'question-bank/question/index.html.twig' %}

{% set lang = app.request.getLocale() %}

{% if lang == 'en' %}
  {% do script(['libs/vue.js','libs/item-bank/lib/itemBank.umd.min.js', 'libs/item-bank/lib/locale/en-US.js', 'app/js/question-manage/form/index.js']) %}
{% else %}
  {% do script(['libs/vue.js','libs/item-bank/lib/itemBank.umd.min.js','app/js/question-manage/form/index.js']) %}
{% endif %}

{% block stylesheets %}
  {{ parent() }}
  {% if maincolor != 'default' and setting('theme.code', 'jianmo') == 'jianmo' %}
    <link href="{{ asset('static-dist/libs/item-bank/lib/styles/item-bank-' ~ maincolor ~ '.css') }}" rel="stylesheet" />
  {% else %}
    <link href="{{ asset('static-dist/libs/item-bank/lib/styles/item-bank.css') }}" rel="stylesheet" />
  {% endif %}
{% endblock %}

{% block container %}
<div class="panel panel-default panel-col">
  <div class="panel-body">
    <div id="question-creator-widget">
      {% verbatim %}
        <div id="app">
        </div>
      {% endverbatim %}
      <input type="hidden" name="mode" value="{{ mode }}">
      <input type="hidden" name="bank_id" value="{{ questionBank.itemBankId }}">
      <input type="hidden" name="type" value="{{ type }}">
      <input type="hidden" name="create_url" value="{{ path('question_bank_manage_question_create', {id: questionBank.id, type: type}) }}">
      <input type="hidden" name="back_url" value="{{ path('question_bank_manage_question_list', {id: questionBank.id}) }}">
      <input type="hidden" name="ckeditor_path" value="{{ asset('static-dist/libs/es-ckeditor/ckeditor.js') }}">
      <input type="hidden" name="jquery_path" value="{{ asset('static-dist/libs/jquery/dist/jquery.min.js') }}">
      <input type="hidden" name="ckeditor_image_upload_url" value="{{ path('editor_upload', {token:upload_token('course')}) }}">
      <input type="hidden" name="ckeditor_image_download_url" value="{{ path('editor_download', {token:upload_token('course')}) }}">
      <input type="hidden" name="category" value="{{ categoryTree|json_encode }}">
      {% include 'attachment-upload/upload-data.html.twig'  %}
      {% if mode == 'edit' %}
        <input type="hidden" name="update_url" value="{{ path('question_bank_manage_question_update', {id: questionBank.id, questionId: item.id}) }}">
        <input type="hidden" name="item" value="{{ item|json_encode }}">
      {% endif %}
    </div>
  </div>
</div>

{% endblock %}

{% block question_category_modal %}{% endblock %}